<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('pm/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
    <input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
    <?php echo $form->renderHiddenFields(false) ?>
            <label for="title"><?php echo $form["title"]->renderLabel(); ?></label>
            <div class="in">
                <?php echo $form["title"]->render(); ?>
                <?php if($form["title"]->hasError() != NULL): ?>
                <div class="ui-state-error">
                    <?php echo $form["title"]->hasError() ?>
                </div>
                <?php endif; ?>
            </div>
            <label for="body"><?php echo $form["body"]->renderLabel(); ?></label>
            <div class="in">
                <?php echo $form["body"]->render(); ?>
                <?php if($form["body"]->hasError() != NULL): ?>
                <div class="ui-state-error">
                    <?php echo $form["body"]->hasError() ?>
                </div>
                <?php endif; ?>
            </div>
        <label for="to"><?php echo $form["to"]->renderLabel(); ?></label>
        <div class="in">
            <?php echo $form["to"]->render(); ?>
                <?php if($form["to"]->hasError() != NULL): ?>
                <div class="ui-state-error">
                    <?php echo $form["to"]->hasError() ?>
                </div>
                <?php endif; ?>
        </div>
    <button type="submit" class="btn primary">Envoyer</button>
</form>
